package ink.feta.task.job.listener;

import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class MyJobListener implements ElasticJobListener {
    private static Logger logger = LoggerFactory.getLogger(MyJobListener.class);

    @Override
    public void beforeJobExecuted(ShardingContexts shardingContexts) {
        logger.info("beforeJob [{}] ",shardingContexts.getJobName());
    }

    @Override
    public void afterJobExecuted(ShardingContexts shardingContexts) {
        logger.info("afterJob [{}] ",shardingContexts.getJobName());
    }

    @Override
    public String getType() {
        return "simpleJobListener";
    }
}
